<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<title>ChelleWeb TAAK</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<link rel="stylesheet" href="css/screen.css" type="text/css" />
<?php
/*session_start();
if($_SESSION['myusername'] != "secretword") {
echo $_SESSION['myusername'];
echo "no way dude";
}*/
$check = TRUE;
include('/PHP/database.php');
if(isset($_POST["get"]))  {
	if($_POST["link"] != ""){
		$db = new db();
		$text = $db->get_content($_POST["link"]);
	} else {
		$check = FALSE;
		$msg = "Please fill out a link";
	}
}
if(isset($_POST["set"])) {
	if(isset($_POST["link"]) && isset($_POST["invul"])){
		$db = new db();
		$msg = $db->set_content($_POST["link"], $_POST["invul"]);
	} else {
		$msg = "there is no content to write";
	}
}
?>
<script src="/JS/jq.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
		$("#addField").click( function() {
			$("#nameFields").append('<label>Name <input type="text" name="first_name[]" /></label><br/>');
		});
	});
</script>
</head>
<body>
<div id="main" >
<div id="banner" >
</div>
<div id="border">
<div id="left">
			<ul>
			<li><a href="index.php?link=home">Home</a></li> 
			<li><a href="index.php?link=tips">Tips</a></li>
			<li><a href="index.php?link=Vragen">Vragen</a></li>
			<li><a href="index.php?link=contact">Contact</a></li>
			<li><a href="admin.php">Admin</a>
				<ul>
					<li><a href="admin.php">Teksten</a></li>
					<li><a href="taak.php">Taken</a></li>
				</ul>
			</li>
		</ul>
		<form method="POST" action="/PHP/login.php">
		Username: <input type="text" name="username" /><br />
		Password: <input type="password" name="password" /><br/>
		<input type="submit" value="Login" />
		</form>
	</div>
<div id="content" > 
	<div id="right">
	</div>
		<div id="text">
        <h2>Administration Page - use with care</h2>
		<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
			<table border="0">
				<tr>
					<td>Link:</td>
					<td><input name="link" type="text" id="link" value="<?php print($_POST["link"]); ?>" /></td>
				</tr>
            </table>
			<p>Content:
				<textarea name="invul" cols=70 rows=20 id="invul"><?php print($text);?></textarea></p>
			<input type="submit" name="get" value="Get Data" />
			<input type="submit" name="set" value="Set Data" />
			<input type="checkbox" name="error" value="error" /> Error reporting
		</form>
		<div id="msg">
		<?php echo $msg; ?>
		</div>
		</div>
</div>
<div id="footer">
	<ul>
		<li><a href="admin.php">admin</a> &#149 </li> 
		<li><a href="index.php?link=pr">pr</a> &#149 </li>
		<li><a href="index.php?link=marketing">marketing</a> &#149</li>
		<li><a href="index.php?link=eventman">event management</a></li>
	</ul>
</div>
</div>
</div>
<?php
if (isset($_POST["error"]) && $check){
	$err = $db->error();
	echo $err;
}
?>
</body>
</html>